TextView

open class TextView : RelativeLayout, RevelControl, DownloadFileTask2.OnCompleted

A custom view that displays text, offering two rendering modes:

  1. Native Rendering: Uses an embedded androidx.appcompat.widget.AppCompatTextView for displaying text directly on the device. This mode supports auto-sizing text.
  2. Image Rendering: Sends the text and styling parameters to a remote service, which generates an image of the text. This image is then downloaded and displayed in an ImageView. This mode can be useful for achieving consistent text appearance across different devices or for complex styling not easily achievable natively.
The rendering mode can be switched using setUseNativeRendering.

This view implements RevelControl for integration into the RevelDigital player system, allowing it to be managed as a content module. It uses DownloadFileTask2 for asynchronous image downloading when in image rendering mode.

See also

Module
DownloadFileTask2.OnCompleted

Constructors

Link copied to clipboard
constructor(context: Context, attrs: AttributeSet)
Constructor for inflating from XML.
constructor(context: Context, attrs: AttributeSet, defStyle: Int)
Constructor for inflating from XML with a default style.
constructor(context: Context, module: Module)
Constructs a new TextView programmatically with a Module.

Functions

Link copied to clipboard
open fun dispose()
Releases any resources held by this control and prepares it for removal or permanent deactivation.
Link copied to clipboard
open fun getName(): String
Gets the unique name assigned to this control.
Link copied to clipboard
open fun getOptions(): Iterator<out Option>
Gets an iterator over the configuration s for this control.
Link copied to clipboard
open fun getPlaylist(): Playlist
Gets the associated with this control, if any.
Link copied to clipboard
open fun getType(): ModuleType
Gets the type of the underlying module or content associated with this control.
Link copied to clipboard
open fun getZIndex(): Int
Gets the Z-index (stacking order) of this control.
Link copied to clipboard
open fun initialize(module: Module)
Initializes the control with its associated module context.
Link copied to clipboard
open fun isAutoStart(): Boolean
Checks if this control is configured to start its operation automatically after #initialize(Module) initialization.
Link copied to clipboard
open fun isStarted(): Boolean
Checks if the control is currently in a started or active operational state.
Link copied to clipboard
open fun onDownloadFileCompleted(file: File)
Callback invoked when the DownloadFileTask2 (for downloading a rendered text image) completes.
Link copied to clipboard
open fun setAutoStart(flag: Boolean)
Sets whether this control should start its operation automatically after #initialize(Module) initialization.
Link copied to clipboard
open fun setText(text: String)
Sets the string value to be displayed by this TextView.
Link copied to clipboard
open fun setUseNativeRendering(useNativeRendering: Boolean)
Sets the rendering mode for this TextView.
Link copied to clipboard
open fun start()
Starts or resumes the active operation of this control.
Link copied to clipboard
open fun stop()
Stops or pauses the active operation of this control.